package simbase.Stats;

import simbase.*;
import java.io.PrintStream;
import java.io.Serializable;

/**
 * A default instance for the Printer interface. Prints all stats on one row
 * with tabs.
 * 
 * @author Joachim Vermeir
 * @version 1.0
 */
public class DefaultPrinter  implements Printer, Serializable {

	public final void printInformation(SimBaseSimulator sim) {
		printInformation(sim, System.out);
	}
	
	public void printInformation(SimBaseSimulator sim, PrintStream out) {
		
		out.println(sim.getAllStats("\t"));
	}

	/**
	 * Prints the list of stats to the given stream.
	 * @param out the stream
	 */
	public static void printHeader(PrintStream out)
	{
		out.println("#STAT_SUCCESS \t STAT_FAIL_CLIENTNODE_JOBREQUEST_OUTPORT_TAKEN \t STAT_FAIL_CLIENTNODE_JOBINFO_OUTPORT_TAKEN \t STAT_FAIL_RESOURCE_JOBINFO_NOFREETIMESLOT \t STAT_FAIL_RESOURCE_JOBINFO_APPLICATION_NOTAVAILABLE \t STAT_FAIL_RESOURCE_JOBINFO_POLICY_REFUSAL \t STAT_FAIL_RESOURCE_DATAREQ_OUTPORT_TAKEN \t STAT_FAIL_RESOURCE_RESULTS_OUTPORT_TAKEN \t STAT_FAIL_RESOURCE_RESULTSDATA_OUTPORT_TAKEN \t STAT_FAIL_RESOURCE_DATAREPLY_OUTPORT_TAKEN \t STAT_FAIL_RESOURCE_DATAREPLY_DATA_NOT_PRESENT \t STAT_FAIL_RESOURCE_DATAREPLY_POLICY_REFUSAL \t STAT_FAIL_RESOURCE_DATAARRIVED_NOFREETIMESLOT \t STAT_FAIL_RESOURCE_DATAARRIVED_JOB_NOT_FOUND \t STAT_FAIL_SERVICE_JOBACK_OUTPORT_TAKEN \t STAT_FAIL_SERVICE_JOBREQ_CANNOT_STORE_RESULTS \t STAT_FAIL_SERVICE_JOBREQ_DATASET_NOT_AVAILABLE \t STAT_FAIL_SERVICE_JOBREQ_NOFREETIMESLOT \t STAT_FAIL_SWITCH_OCS_NOTSUPPORTED \t STAT_FAIL_SWITCH_OCSSETUP_NOWAVELENGTH \t STAT_FAIL_SWITCH_OCSSETUP_OUTPORT_TAKEN \t STAT_FAIL_SWITCH_OCSTEARDOWN_NOSUCHPATH \t STAT_FAIL_SWITCH_GRIDMSG_OUTPORT_TAKEN \t STAT_FAIL_SWITCH_GRIDMSG_SYNCH_ERROR \t STAT_COUNT_ROUNDTRIPDELAY \t STAT_MSG_RECEIVED \t STAT_MSG_GRID_RECEIVED \t STAT_MSG_GRID_FORWARDED \t STAT_MSG_OCS_RECEIVED \t STAT_MSG_OCS_FORWARDED \t STAT_MSG_JOB_REQ_SENT \t STAT_MSG_JOB_REQ_RECEIVED \t STAT_MSG_JOB_REQ_ACK_SENT \t STAT_MSG_JOB_REQ_ACK_RECEIVED \t STAT_MSG_JOB_INFO_SENT \t STAT_MSG_JOB_INFO_FORWARDED \t STAT_MSG_JOB_INFO_RECEIVED \t STAT_MSG_JOB_RESULT_SENT \t STAT_MSG_JOB_RESULT_FORWARDED \t STAT_MSG_JOB_RESULT_RECEIVED \t STAT_MSG_GENERATOR_SENT \t STAT_MSG_GENERATOR_RECEIVED \t STAT_MSG_REGISTRATION_SENT \t STAT_MSG_REGISTRATION_RECEIVED \t STAT_MSG_UPDATE_SENT \t STAT_MSG_UPDATE_RECEIVED \t STAT_JOB_STARTED \t STAT_JOB_FINISHED \t STAT_MSG_OCS_PATH_SETUP_RECEIVED \t STAT_MSG_OCS_PATH_SETUP_FORWARDED \t STAT_MSG_OCS_PATH_SETUP_SENT \t STAT_MSG_OCS_PATH_REQUEST_SENT \t STAT_MSG_OCS_PATH_REQUEST_FORWARDED \t STAT_MSG_OCS_PATH_REQUEST_RECEIVED \t STAT_MSG_OCS_PATH_ACK_SENT \t STAT_MSG_OCS_PATH_ACK_FORWARDED \t STAT_MSG_OCS_PATH_ACK_RECEIVED \t STAT_MSG_OCS_PATH_TEARDOWN_SENT \t STAT_MSG_OCS_PATH_TEARDOWN_FORWARDED \t STAT_MSG_OCS_PATH_TEARDOWN_RECEIVED \t STAT_MSG_OCS_PATH_TEARDOWN_REQUEST_SENT \t STAT_MSG_OCS_PATH_TEARDOWN_REQUEST_FORWARDED \t STAT_MSG_OCS_PATH_TEARDOWN_REQUEST_RECEIVED \t STAT_RESOURCE_BUSY_TIME \t STAT_MSG_BIT_ERROR \t STAT_BIT_ERROR \t STAT_SAME_NETWORK_RESOURCE \t STAT_DIFF_NETWORK_RESOURCE \t STAT_NO_ROUTE \t STAT_SWITCH_INTERNAL_DROP \t STAT_SWITCH_INTERNAL_DROP_SWITCH \t STAT_SWITCH_INTERNAL_FAST \t STAT_SWITCH_INTERNAL_TOFAST \t STAT_SWITCH_INTERNAL_DROP_CONGESTION \t STAT_SWITCH_INTERNAL_SWITCHED \t STAT_SWITCH_INTERNAL_SUCCESS \t STAT_POWER_UP \t STAT_POWER_DOWN \t STAT_POWER_ON \t STAT_POWER_MEAN_TIME_BETWEEN_SHUTDOWN_AND_STARTUP");
	}
}
